x86/emul: Simplfy L{ES,DS,SS,FS,GS} handling
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 14 Dec 2016 11:05:18 +0000 (11:05 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 16 Dec 2016 13:49:24 +0000 (13:49 +0000)
commitcaf520b2c61a35cdb196e850443038d367c10238
tree379148b362bf6ce9aa6cccaa931c49f9e6efe692
parentd03eda9de93708123bfb5449ce80f69eca57303e
x86/emul: Simplfy L{ES,DS,SS,FS,GS} handling

%ss, %fs and %gs can be calculated by directly masking the opcode.  %es and
%ds cant, but the calculation isn't hard.

Use seg rather than dst.val for storing the calculated segment, which is
appropriately typed.  Drop the sel local variable entirely and use dst.val
instead.  The mode_64bit() check can be repositioned and simplified to drop
the ext check.  Replace opencoding of X86EMUL_OKAY.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/x86_emulate/x86_emulate.c